
/**
 * Date:2019年6月4日上午11:34:40
 * Copyright (c) 2019, www.bwbroad.com All Rights Reserved.
 *
*/

package com.xue.im.client.ui;

import java.awt.Dimension;
import java.awt.Point;
import java.awt.Toolkit;

/**
 * Description: TODO <br/>
 * Date: 2019年6月4日 上午11:34:40 <br/>
 * 
 * @author xuejianxin
 */
public class WindowXY {
	public static Point getXY(int w, int h) {
		Toolkit toolkit = Toolkit.getDefaultToolkit();
		int width = toolkit.getScreenSize().width;
		int height = toolkit.getScreenSize().height;
		return new Point((width - w) / 2, (height - h) / 2);
	}

	public static Point getXY(Dimension dimension) {
		return getXY(dimension.width, dimension.height);
	}
}
